PHP implementation of closed HTML tags, PHP complement HTML tags
The example in this article describes the HTML tags that PHP implements to close. Share to everyone for your reference, as follows:
Most of the time, when we make a fuss about
PHP implements completion of closed HTML tags, and php supplements html tags. PHP implements completion of closed HTML tags. php supplements html tags. this example describes how PHP implements completion of closed HTML tags. For your reference, we
In php, the most common HTML tag can be replaced by the strip_tags function, which can be used to filter all html tags, next I will introduce other methods besides this function.
Sometimes we need to store html tabs in the database, but in some
PHP implements completion of closed HTML tags, and php supplements html tags
The example in this article describes how to complete and disable HTML tags in PHP. We will share this with you for your reference. The details are as follows:
Most of the
PHP strip_tags () goes to the function of HTML, XML, and PHP tags in the string, Strip_tagsxml
Strip_tags Definition and usage
The Strip_tags () function strips the HTML, XML, and PHP tags from the string.
Note: This function always strips HTML
Sometimes we need to store html tabs in the database, but in some cases we need to take pure data without html tags. At this time, we need to process the data with html tags, remove all html tags. Htmlspecialchars () is usually used to filter html,
First, let's look at your own writing method. The code is as follows:Copy code Str_replace ("", '', str_replace (' ','', str_replace ('', '', $ vv )))The simplest method is to replace the two divs specified in the $ vv variable. Later, we found
Instance
Peel the HTML tags from the string:
world!");? >
Definition and usage
The Strip_tags () function strips the HTML, XML, and PHP tags from the string.
Note: This function always strips HTML comments. This cannot be changed by the Allow
This article mainly introduces how PHP can complete closed HTML tags. it uses custom functions to implement closed and complete HTML tags, involving PHP string and regular expression matching related operation skills, for more information, see the
Strip_tags get rid of HTML and PHP tags.Syntax: string strip_tags (String str);return value: StringTypes of functions: Data processingContent DescriptionThis function can remove any HTML and PHP tag strings contained in the string. If the HTML and
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.